namespace CSharpPro._1009;

public class Demo
{
    public void TestPrint()
    {
        int num = 10;
        for(int i = 0; i < num; i++)
        {
            if (i == 6)
            {
                break;
            }
            Console.Write(i+"\t");
        }
    }

    public void TestPrint2()
    {
        for (int num = 100; num < 1000; num++)
        {
            int a = num / 100;
            int b = num / 10 % 10;
            int c = num % 10;
            if (num == a * a * a + b * b * b + c * c * c)
            {
                Console.Write(num+"\t");
            }
        }
    }

    public void TestPrint3()
    {
        for (int num = 2; num <= 100; num++)
        {
            bool a = true;
            for (int i = 2; i <= Math.Sqrt(num); i++)
            {
                if (num % i == 0)
                {
                    a = false;
                    break;
                }
            }

            if (a)
            {
                Console.Write(num+" ");
            }
        }
    }
}